<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserSettingsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_settings', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->boolean('show_index_page')->default(true)->comment('是否允许查看主页');
            $table->boolean('show_collects')->default(true)->comment('是否显示看单');
            $table->boolean('show_watching')->default(true)->comment('是否显示正在看的电影');
            $table->boolean('show_watched')->default(true)->comment('是否显示看过的电影');
            $table->boolean('show_timeline')->default(true)->comment('是否显示动态');
            $table->boolean('show_comments')->default(true)->comment('显示评论');
            $table->unsignedBigInteger('user_id');
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_settings');
    }
}
